package com.mutual.help.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import com.mutual.help.dao.PictureMapper;
import com.mutual.help.entity.Picture;
import com.mutual.help.service.PictureService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class PictureServiceImpl extends ServiceImpl<PictureMapper, Picture> implements PictureService {

    @Override
    public List<Picture> getAllPicture(Integer page, Integer limit) {
        PageHelper.startPage(page, limit);
        List<Picture> pictures = baseMapper.selectList(null);
        return pictures;
    }

    @Override
    public Integer countData() {
        List<Picture> pictures = baseMapper.selectList(null);
        return pictures.size();
    }
}
